" main-plug.vim

" 视觉
if get(g:, 'file_explorer_plugin') ==# 'nerdtree'
    Plug 'scrooloose/nerdtree'
    Plug 'lmeijvogel/nerdtree-copypaste'
elseif get(g:, 'file_explorer_plugin') ==# 'defx'
    if has('nvim')
        Plug 'Shougo/defx.nvim', { 'do': ':UpdateRemotePlugins' }
    else
        Plug 'Shougo/defx.nvim'
        Plug 'roxma/nvim-yarp'
        Plug 'roxma/vim-hug-neovim-rpc'
    endif
elseif get(g:, 'file_explorer_plugin') ==# 'fern'
    Plug 'lambdalisue/fern.vim'
endif
Plug 'Yggdroot/indentLine'

" 集成 
Plug 'embear/vim-localvimrc'
Plug 'tpope/vim-fugitive'
Plug 'lilydjwg/fcitx.vim'
Plug 'skywind3000/asyncrun.vim'

" 编辑
Plug 'stefandtw/quickfix-reflector.vim' 
Plug 'easymotion/vim-easymotion'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-abolish'
if get(g:, 'commentary_plugin') ==# 'nerdcommenter'
    " 使用 `<leader>c<space>` 切换注释
    Plug 'scrooloose/nerdcommenter'
elseif get(g:, 'commentary_plugin') ==# 'vim-commentary'
    " 使用 `gcc`(normal mode) 和 `gc`(visual mode) 切换注释
    Plug 'tpope/vim-commentary' 
endif
Plug 'kana/vim-textobj-user'
Plug 'glts/vim-textobj-comment'
Plug 'Raimondi/delimitMate'
" 最新的提交应用 Ruby 时会有问题
Plug 'tpope/vim-endwise', { 'commit': '4289889a2622f9bc7c594a6dd79763781f63dfb5' }
Plug 'godlygeek/tabular'
if !get(g:, 'loaded_completion_plugin')
    if get(g:, 'completion_plugin') ==# 'neocomplecache'
        Plug 'Shougo/neocomplcache.vim' 
        Plug 'Shougo/neosnippet.vim' 
        Plug 'Shougo/neosnippet-snippets'
    elseif get(g:, 'completion_plugin') ==# 'ncm2'
        Plug 'ncm2/ncm2'
        Plug 'roxma/nvim-yarp'

        Plug 'ncm2/ncm2-bufword'
        Plug 'ncm2/ncm2-path'
        " JavaScript
        Plug 'ncm2/ncm2-tern',  {'do': 'npm install'}
    elseif get(g:, 'completion_plugin') ==# 'coc.nvim'
        Plug 'neoclide/coc.nvim', {'branch': 'release'}
    else
        echom '不支持的补全插件：'.get(g:, 'completion_plugin').'，请检查 vimrc 配置文件。'
    endif
endif

" 效率
Plug 'Yggdroot/LeaderF'
if !get(g:, 'disable_ale')
    Plug 'dense-analysis/ale' " , { 'on':  'ALEToggle' }
endif
Plug 'vim-scripts/tinymode.vim'
Plug 'dkprice/vim-easygrep'

" 语言（优先sheerun/vim-polyglot成员）
Plug 'plasticboy/vim-markdown' " tabular 插件一定要出现在前面
" 加上这个插件也不能解决[#129](https://github.com/posva/vim-vue/issues/129)的问题
" Plug 'othree/html5.vim' 
Plug 'pangloss/vim-javascript'
Plug 'neoclide/jsonc.vim'
" Plug 'posva/vim-vue'
Plug 'leafOfTree/vim-vue-plugin' 
Plug 'Vimjas/vim-python-pep8-indent'
Plug 'rlue/vim-fold-rspec' 
